<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20101229;14484200">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>femlagspher</B></FONT>

<FONT SIZE=4><SPAN LANG="en-US">Solves a second order <SPAN STYLE="font-style: normal">self-adjoint linear two point boundary value problem with spherical coordinates by means of  Galerkin's method with continous piecewise polynomials.</SPAN></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to open the editor)</B></SPAN></FONT>


import java.text.DecimalFormat;
import numal.*;

public class Test_femlagspher extends Object
                              implements AP_femlagspher_methods {

  static int nc;
  
	public static void main(String args[]) {

    int n,i,order;
    double rho,d;
    double x[] = new double[21];
    double y[] = new double[21];
    double e[] = new double[7];
    
    Test_femlagspher testfemlagspher = new Test_femlagspher();
    DecimalFormat twoDigit = new DecimalFormat(&quot;0.00E0&quot;);
    System.out.println(&quot;FEMLAGSPHER delivers:\n&quot;);
    for (n=10; n&lt;=20; n += 10)
      for (nc=0; nc&lt;=2; nc++) {
        e[2]=e[4]=1.0;
        e[1]=e[3]=e[5]=e[6]=0.0;
        for (i=0; i&lt;=n; i++) x[i]=(float)(i)/(float)(n);
        System.out.println(&quot;N= &quot; + n + &quot;    NC=&quot; + nc);
        for (order=2; order&lt;=4; order += 2) {
          Analytic_problems.femlagspher(x,y,n,nc,testfemlagspher,
                                        order,e);
          rho=0.0;
          for (i=0; i&lt;=n; i++) {
            d=Math.abs(y[i]-1.0+x[i]*x[i]*x[i]*x[i]);
            if (rho &lt; d) rho=d;
          }
          System.out.println(&quot;         ORDER = &quot; + order +
          &quot;    MAX.ERROR = &quot; + twoDigit.format(rho));
        }
      }
  }


  public double r(double x)
  {
  return 1.0;
  }


  public double f(double x)
  {
    return (12+4*nc)*x*x+1.0-x*x*x*x;
  }
}</PRE>
</BODY>
</HTML>